package com.gxa.controller.addbox;

import com.gxa.common.Constants;
import com.gxa.common.ResponseData;
import com.gxa.service.WarehouseStoresService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: tx
 * Date: 2020/10/28 10:53
 * Description:入库门店下拉框
 * Version: V1.0
 */
@RestController
@RequestMapping("/addbox")
@Api(value = "下拉框新增接口",tags = "下拉框新增接口")
public class WarehouseStoresController {
    @Autowired
    private ResponseData responseData;
    @Autowired
    private WarehouseStoresService warehouseStoresService;
    @GetMapping("/querywarehousestores")
    @ApiOperation(value = "查询入库门店接口", notes = "根据信息查询入库门店下拉框", httpMethod = "get", response = ResponseData.class)
    @ApiResponses({
            @ApiResponse(code = 200, message = "查询成功"),
            @ApiResponse(code = 400, message = "找不到页面"),
            @ApiResponse(code = 500, message = "查询失败")
})
public ResponseData queryWarehouseStores(){
    List<String> war_branch_names = warehouseStoresService.queryWarehouseStores();
    if(war_branch_names != null){
        responseData.setCode(Constants.SUCCESS);
        responseData.setMsg("查询成功");
        responseData.setData(war_branch_names);
    }
    return responseData;
}

}
